#!/bin/bash
read -p "请输入一个大于0的数：" num
result=true
i=1
length=$[$num - $i]
for x in `seq 2 $length`
do
  num1=$[$num % $x]
  if[$num1 -eq 0];
  then
    result=false
    break
  fi
  done
  if(result==true);
  then
    echo "$num是素数"
  else
    echo "$num不是素数"
  fi